<?php $title_show = empty ($datacontent['id'])?"Add":"Edit"; ?>
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>public/skin/back-end/css/chantable.css"/>
<h1>Recipe Management <span class="greysubheading"><?php echo $title_show; ?></span></h1>

<form id="news-form" action="" method="POST" enctype="multipart/form-data" name="form">
<div id="c_wapper">
    <fieldset ><legend>Field:</legend>
        <table>
            <tbody>
               <?php echo textfield('name','Name',((array_key_exists('name', $datacontent))?$datacontent['name']:null))?>
                <?php echo textfield('alias','Alias',((array_key_exists('alias', $datacontent))?$datacontent['alias']:null))?>
                <?php $rateTmp = array(); 
                    for($i=1;$i<=5;$i++){
                        $rateTmp[$i] = $i;
                    }
                ?>
                <?php echo dropdown('rating','Rating',$rateTmp,((array_key_exists('rating', $datacontent))?$datacontent['rating']:null))?>

                <?php echo textfield('servings','Servings',((array_key_exists('servings', $datacontent))?$datacontent['servings']:null))?>

                <?php echo textfield('preparation','Preparation',((array_key_exists('preparation', $datacontent))?$datacontent['preparation']:null))?>
                <?php echo textfield('cooking_time','Cooking Time',((array_key_exists('cooking_time', $datacontent))?$datacontent['cooking_time']:null))?>
                <?php echo textfield('marinating','Marinating',((array_key_exists('marinating', $datacontent))?$datacontent['marinating']:null))?>
                <?php echo textfield('total','Total',((array_key_exists('total', $datacontent))?$datacontent['total']:null))?>
                <?php echo richtext('alldescription','Description',((array_key_exists('alldescription', $datacontent))?$datacontent['alldescription']:null))?>
                <?php echo array_key_exists('order', $datacontent) ? dropdown('order','Order',$total_item,((array_key_exists('order', $datacontent))?$datacontent['order']:null)): ""?>
                <?php echo image('images','Images',((array_key_exists('images', $datacontent))?$datacontent['images']:null))?>
            </tbody>
        </table>
    </fieldset>
  <table>
        <tr>
          <td>
              <button type="submit" id="button">Edit</button>
              <button type="reset" id="reset" onClick="location.reload(true)" id="button">Reset</button>
          </td>
        </tr>
  </table>
</div>
</form>
	